<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //         function max(arr) {
      //     arr = arr.slice().sort();
      //     var temp = +!!arr.length, count = temp;
      //     var next, cur = arr.shift(), ret = cur;
      //     for (;;) {
      //         if (!arr.length) return ret;
      //         next = arr.shift();
      //         temp = cur === next ? ++temp : 1;
      //         if (temp > count) {
      //             count = temp;
      //             ret = cur;
      //         }
      //         cur = next;
      //     }
      // }
      // console.dir(max([1, 2, 3, 4, "1", 2]));
      console.log(1)
      setTimeout(() => {
        console.log(2)
      }, 100)
      new Promise((resolve1) => {
        console.log(3)
        resolve1()
      })
        .then((res) => {
          console.log(4)
        })
        .then(() => {
          console.log(6)
        })
      console.log(5)
    </script>
  </body>
</html>
